package com.wqz.dao;

import com.wqz.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserDao {

    public User findUserById(Integer userId) throws Exception;

    public List<User> get(@Param("gender") int gender, @Param("userName") String userName ) throws Exception;

    /**
     * 通过对象传递参数
     * @param user
     * @return
     * @throws Exception
     */
    public List<User> findByUser(@Param("user") User user) throws Exception;
    /**
     * 通过Map集合传参
     * @param map
     * @return
     * @throws Exception
     */
    public List<User> findByMap(@Param("map")Map<String, Object> map) throws Exception;

    /**
     * 修改用户信息
     * @param user
     * @return
     * @throws Exception
     */
    public int modifyUser(@Param("user") User user) throws Exception;

    /**
     * 添加用户
     * @param user
     * @return
     * @throws Exception
     */
    public int addUser(@Param("user") User user) throws Exception;

    /**
     * 删除用户
     * @param user
     * @return
     * @throws Exception
     */
    public int deleteUser(@Param("user") User user) throws Exception;

}
